//
//  TJHomeHeaderView.m
//  CrossBorderPayment
//
//  Created by hc-101 on 2020/6/9.
//  Copyright © 2020 xtjun. All rights reserved.
//

#import "TJHomeHeaderView.h"


@interface TJHomeHeaderView()

@property (weak, nonatomic) UILabel *BTCValueLabel;
@property (weak, nonatomic) UILabel *CNYValueLabel;


@end


@implementation TJHomeHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        

        UILabel *assetsLabel = [UILabel lableWithSuperView:self font:MediumFont(18) color:UIColor_Hex(0x111111) title:@"我的资产".localizedString textAlignment:NSTextAlignmentCenter];
        [assetsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.offset(20);
            make.left.offset(16);
        }];
        
        UILabel *titleLabel = [UILabel lableWithSuperView:self font:UIFont_Px(15) color:UIColor_Hex(0x333333) title:@"资产估值".localizedString textAlignment:NSTextAlignmentCenter];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(assetsLabel.mas_bottom).offset(16);
            make.centerX.offset(0);
        }];
        
        UILabel *BTCValueLabel = [UILabel lableWithSuperView:self font:MediumFont(30) color:UIColor_Hex(0x111111) title:@"" textAlignment:NSTextAlignmentCenter];
        [BTCValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(titleLabel.mas_bottom).offset(14);
            make.centerX.offset(0);
        }];
        
        UILabel *CNYValueLabel = [UILabel lableWithSuperView:self font:UIFont_Px(14) color:UIColor_Hex(0x666666) title:@"" textAlignment:NSTextAlignmentCenter];
        [CNYValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(BTCValueLabel.mas_bottom).offset(12);
            make.centerX.offset(0);
        }];
        
        UILabel *detailLabel = [UILabel lableWithSuperView:self font:MediumFont(15) color:UIColor_Hex(0x333333) title:@"详情".localizedString textAlignment:NSTextAlignmentCenter];
        [detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(CNYValueLabel.mas_bottom).offset(20);
            make.left.offset(16);
        }];
        
        _BTCValueLabel = BTCValueLabel;
        _CNYValueLabel = CNYValueLabel;
        
    }
    return self;
}


- (void)setDict:(NSDictionary *)dict {
    _dict = dict;
    
    _BTCValueLabel.text = [NSString stringWithFormat:@"%@USDT", [Tools CNYString:[NSString stringWithFormat:@"%@", dict[@"usdtPrice"]]]];
 _CNYValueLabel.text = [NSString stringWithFormat:@"≈%@CNY", [Tools CNYString:[NSString stringWithFormat:@"%@", dict[@"cnyPrice"]]]];

}

@end
